
#ifndef  __LP_CONFIG_H__
#define __LP_CONFIG_H__

typedef struct _lpSetCfg
{
    unsigned char method;	// 0 :tcp , 1:mqtt

	unsigned char wakeup_host;

	char hostname[128];
	unsigned int port;

	char mqtt_clientid[128];
	char mqtt_username[128];
	char mqtt_password[128];
	char mqtt_wakeup_topic[128];

	char tcp_login[128];
	char tcp_login_resp[128];

	char tcp_heart[128];
	char tcp_heart_resp[128];

	char tcp_wakeup[128];
	
	unsigned int tcp_heart_interval;
	unsigned int tcp_heart_miss_max;

}lpSetCfg;

typedef enum
{
	LP_WAKEUP_NONE,
	LP_WAKEUP_POWERUP = 1,
	LP_WAKEUP_GPIO = 2,
	LP_WAKEUP_MQTT_CONNECT_FAIL = 3,
	LP_WAKEUP_MQTT_RECV_WAKUPTOPIC = 4,
	LP_WAKEUP_MQTT_DISCONNECT = 5,
	LP_WAKEUP_TCP_CONNECT_FAIL = 6,
	LP_WAKEUP_TCP_RECV_WAKUP = 7,
	LP_WAKEUP_TCP_SEND_HEART_FAIL = 8,
	LP_WAKEUP_TCP_DISCONNECT = 9,

	LP_WAKEUP_MAX
}lpWakeupReason;


typedef enum
{
	MQTT_CMD_NONE,
	MQTT_CMD_START = 1,
	MQTT_CMD_STOP = 2,
	MQTT_CMD_SLEEP = 3,
	MQTT_CMD_WAKEUP = 4,

	MQTT_CMD_MAX
}lpMqttCmdE;

typedef enum
{
	TCP_CMD_NONE,
	TCP_CMD_START = 1,
	TCP_CMD_STOP = 2,
	TCP_CMD_SUSPEND = 3,
	TCP_CMD_WAKEUP = 4,

	TCP_CMD_MAX
}lpTcpCmdE;


lpSetCfg * getLpCfgInfo(void);

void lp_wakeup(void);
void lp_sleep(void);

#endif

